<?php $section = 'Shop'; ?>
<!DOCTYPE html>

<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>N02243545</title>
    <link rel="stylesheet" type="text/css" href="../css/reset.css">
    <link rel="stylesheet" type="text/css" href="../css/style.css">
  </head>

  <body>
<?php
include('../inc/nav.php');
include('../inc/header.php');
?>
    <div id="col-left">
      <ul class="menu">
<?php include('menu.php'); ?>
      </ul>
    </div><!-- #col-left -->
    
    <div id="content" class="left">
<?php
if(!empty($_GET['cat'])):
    $cat_id = $_GET['cat'];
    $q = mysql_query("SELECT * FROM products WHERE category_id='$cat_id'");
?>
      <table class="shop">
<?php while($row = mysql_fetch_assoc($q)): ?>
        <tr>
          <td class="left">
            <div id="img">
              <img src="" />
            </div>
            <ul class="left">
              <li class="name">
                <a href="#"><?php echo $row['name']; ?></a>
              </li>
              <li>Description: <?php echo $row['description']; ?></li>
              <li>Weight: <?php echo $row['weight']; ?> kg</li>
            </ul>
          </td>
          <td class="right">
            <ul>
              <li>MSRP: $<?php echo $row['msrp']; ?></li>
              <li>Stock: <?php echo $row['stock']; ?></li>
              <li class="cart-button">
                <input type="button" value="Add to cart">
              </li>
            </ul>
          </td>
        </tr>
<?php endwhile; ?>
      </table>
<?php else: ?>
      <p>No items found.</p>
<?php endif; ?>
    </div><!-- #content -->
<?php include('../inc/footer.php'); ?>
  </body>
</html>
